﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartSpace
{
    public static class Logger
    {
        static Logger()
        {
            log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ".\\_configs\\log4net.config")));
        }

        public static void Info(string message)
        {
            log4net.ILog log = log4net.LogManager.GetLogger("smartspace");
            log.Info(message);
        }

        public static void Info(string message, Exception exception)
        {
            log4net.ILog log = log4net.LogManager.GetLogger("smartspace");
            log.Info(message, exception);
        }

        public static void Info(string module, string message)
        {
            log4net.ILog log = log4net.LogManager.GetLogger(module);
            log.Info(message);
        }

        public static void Info(string module, string message, Exception exception)
        {
            log4net.ILog log = log4net.LogManager.GetLogger(module);
            log.Info(message, exception);
        }

        public static void Error(string message)
        {
            log4net.ILog log = log4net.LogManager.GetLogger("smartspace");
            log.Error(message);
        }

        public static void Error(string message, Exception exception)
        {
            log4net.ILog log = log4net.LogManager.GetLogger("smartspace");
            log.Error(message, exception);
        }

        public static void Error(string module, string message)
        {
            log4net.ILog log = log4net.LogManager.GetLogger(module);
            log.Error(message);
        }

        public static void Error(string module, string message, Exception exception)
        {
            log4net.ILog log = log4net.LogManager.GetLogger(module);
            log.Error(message, exception);
        }

        public static void Debug(string message)
        {
            log4net.ILog log = log4net.LogManager.GetLogger("smartspace");
            log.Debug(message);
        }

        public static void Debug(string message, Exception exception)
        {
            log4net.ILog log = log4net.LogManager.GetLogger("smartspace");
            log.Debug(message, exception);
        }

        public static void Debug(string module, string message)
        {
            log4net.ILog log = log4net.LogManager.GetLogger(module);
            log.Debug(message);
        }

        public static void Debug(string module, string message, Exception exception)
        {
            log4net.ILog log = log4net.LogManager.GetLogger(module);
            log.Debug(message, exception);
        }

        public static void Warn(string message)
        {
            log4net.ILog log = log4net.LogManager.GetLogger("smartspace");
            log.Warn(message);
        }

        public static void Warn(string message, Exception exception)
        {
            log4net.ILog log = log4net.LogManager.GetLogger("smartspace");
            log.Warn(message, exception);
        }

        public static void Warn(string module, string message)
        {
            log4net.ILog log = log4net.LogManager.GetLogger(module);
            log.Warn(message);
        }

        public static void Warn(string module, string message, Exception exception)
        {
            log4net.ILog log = log4net.LogManager.GetLogger(module);
            log.Warn(message, exception);
        }
    }
}
